package cn.cyh.imeans.bat;

import java.util.Scanner;
import java.util.regex.Pattern;

public class MyTest2 {

    public static void main(String[] args) {
        System.out.println("please inpput your birth(format to zhangsan_nongli_19990101_birth):");
        Scanner scanner = new Scanner(System.in);
        String line = scanner.nextLine();

        Pattern pattern = Pattern.compile("^[\\u4e00-\\u9fa5A-Za-z0-9_]{1,40}$");
        if(!pattern.matcher(line).matches()) {
            System.out.println("输入不合法");
            return;
        }
        String[] split = line.split("_");
        if(split.length != 4) {
            System.out.println("输入不合法");
            return;
        }
        System.out.println("姓名："+ split[0]);
        System.out.println("日期类型："+ split[1]);
        System.out.println("年月日："+ split[2]);
        System.out.println("纪念内型："+ split[3]);
    }
}
